package com.newer.autoupdataapk;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class NewActivity extends Activity {

    private Button update;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        update = (Button) findViewById(R.id.button1);

        update.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View arg0) {
                //TODO 这里 判断是否需要更新,及取的更新地址
                String address="http://www.ehushi.net/download/android/";
               Intent mIntent=new Intent(NewActivity.this, UpdateService.class);
               mIntent.putExtra("URL", address);
                startService(mIntent);
            }
        });

    }

  
}
